
// day27 不用加减乘除做加法
public class Add {
    public static int add(int num1,int num2) {
        while (num2 != 0) {
            int a = num1 ^ num2;
            int b = (num1 & num2) << 1;
            num1 = a;
            num2 = b;
        }
        return num1;
    }

    public static void main(String[] args) {
        System.out.println(add(1, 2));
    }
}
